﻿@page "/System/App"
@namespace MXERP.Client.Pages.Systems
@attribute [Authorize]
<View>
    <ButtonContent>
        <MudButton Variant="Variant.Filled" Color="Color.Primary" StartIcon="@CustomIcon.Fluent.Add">添加</MudButton>
        <MudButton Variant="Variant.Filled" Color="Color.Warning" StartIcon="@CustomIcon.Fluent.Edit" OnClick="Edit">修改</MudButton>
        <PopConfirm PositiveClick="Remove" Title="是否删除?" Placement="Placement.Top">
            <MudButton Variant="Variant.Filled" Color="Color.Error" StartIcon="@Icons.Material.Filled.Delete">删除</MudButton>
        </PopConfirm>
    </ButtonContent>
    <ChildContent>
        <Table 
            Items="@_apps"
            TreeChildren="x => x.Children"
            Outlined
            Class="mud-height-full"
            Height="100%"
            @bind-SelectedItems="_selectedItems">
            <Columns>
                <MXERP.Blazor.Components.SelectColumn T="AppTreeResponse" />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.Title" Title="应用名称" Width="200" Ellipsis StickyLeft/>
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.Icon" Title="图标" Width="100" Ellipsis StickyLeft />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.Name" Title="路由名称" Width="200" Ellipsis StickyLeft />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.Type" Title="类型" Width="100" StickyLeft />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.Path" Title="路由路径" Width="200" Ellipsis />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.Component" Title="组件名称" Width="200" Ellipsis />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.License" Title="许可证" Width="200" Ellipsis />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.IsKeepAlive" Title="是否缓存" Width="90">
                    <CellTemplate>
                        <MudSwitch Size="Size.Small" ReadOnly @bind-Value="@context.Item.IsKeepAlive" Color="Color.Primary" />
                    </CellTemplate>
                </MXERP.Blazor.Components.PropertyColumn>
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.IsAffix" Title="是否固定" Width="90" />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.IsMultiTab" Title="是否支持多个tab页签" Width="170" />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.IsHide" Title="是否隐藏" Width="90" />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.IsIframe" Title="是否内嵌" Width="90" />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.IsLink" Title="是否外链" Width="90" />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.Sort" Title="排序" Width="100" />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.Remark" Title="备注" Width="250" Ellipsis />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.CreatedByName" Title="创建人" Width="110" />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.CreatedOn" Title="创建时间" Width="170" />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.UpdatedByName" Title="更新人" Width="110" />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.UpdatedOn" Title="更新时间" Width="170"/>
            </Columns>
        </Table>
    </ChildContent>
</View>
